package com.managertrade.common;

import lombok.Getter;

@Getter
public enum ErrorCode {

    // ========== 通用异常 ==========
    SYSTEM_ERROR(500, "系统错误"),
    PARAM_ERROR(400, "参数错误"),
    UNAUTHORIZED(401, "登陆过期，请重新登陆"),
    FORBIDDEN(403, "没有权限"),
    NOT_FOUND(404, "资源不存在"),

    // ========== 用户模块 ==========
    USER_NOT_FOUND(1001, "用户不存在"),
    PASSWORD_ERROR(1002, "密码错误"),
    ROLE_CODE_NOT_FOUND(1003, "角色不存在"),
    USER_ROLE_CODE_NOT_FOUND(1004, "用户角色不存在"),
    ROLE_EXIT_USER(1005, "角色存在用户，不能删除"),
    // ========== 业务自定义异常可持续扩展 ==========
    USER_NOT_LOGIN(2000,"未登录"),
    FAIL_TRADE_VIEW(2001,"获取行情失败")
    ;

    private final Integer code;
    private final String msg;

    ErrorCode(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }
}

